package PatternPrinting;

import java.util.Scanner;

/**
 * Created by revathyr on 7/8/14.
 */
public class DrawIsocelesTriangle {
    public static void main(String[] args)
    {
        DrawIsocelesTriangle draw=new DrawIsocelesTriangle();
        Scanner in=new Scanner(System.in);
        System.out.println("enter a number.. (the number must be odd)");
        int n=in.nextInt();
        draw.drawIsocelesTriangle(n);

    }

    private void drawIsocelesTriangle(int n) {
        int mid= ((n+(n-1))/2)+1;int count=0;
        for(int num=1;num<=n;num++){

        for(int i=1;i<(mid-count);i++)
        {
            System.out.print("  ");
        }
        for(int j=(mid-count);j<=(mid+count);j++)
        {
            System.out.print("*"+" ");
        }
            System.out.println("");

        count++;


    }
}}
